package com.auth.client.config.context;

import com.auth.client.config.domain.User;

/**
 * @author: mhSui 2020/07/01
 */
public abstract class UserContext {

    private static ThreadLocal<User> users = new ThreadLocal();

    public UserContext() {
    }

    public static void set(User user) {
        users.set(user);
    }

    public static User get() {
        return (User)users.get();
    }

    public static void clear() {
        users.set((User) null);
        users.remove();
    }
}
